program FairSquareTest;

{$APPTYPE CONSOLE}

{$R *.res}

uses
  System.SysUtils;

var
  f, g: TextFile;

var
  fs, st: Int64;
begin
  try
    AssignFile(f, 'FirstFS.txt');
    Reset(f);
    AssignFile(g, 'ProcessedFS.txt');
    Rewrite(g);
    try
       while not eof(F) do begin
        Readln(f, fs);
        st := Trunc(Sqrt(fs));
        Writeln(g, st, ' ^2 = ', fs);
        Flush(g);
      end;
    finally
      CloseFile(f);
      CloseFile(g);
    end;
    { TODO -oUser -cConsole Main : Insert code here }
  except
    on E: Exception do begin
      Writeln(E.ClassName, ': ', E.Message);
      readln;
    end;
  end;
end.
